package com.fkcai.hansoul.ai.model.vo;

import com.fkcai.hansoul.ai.model.entity.AiChatHistory;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class AiChatVo {
	private String answer; // 回复
	private String sessionId; // 会话 ID
	private LocalDateTime createTime; // 创建时间
	
	/**
	 * 从 AiChatHistory 对象中创建 AiChatVo 对象
	 * @param aiChatHistory AiChatHistory 对象
	 * @return AiChatVo 对象
	 */
	public static AiChatVo fromAiChatHistory (AiChatHistory aiChatHistory) {
		AiChatVo aiChatVo = new AiChatVo();
		aiChatVo.setAnswer(aiChatHistory.getAnswer());
		aiChatVo.setSessionId(aiChatHistory.getSessionId());
		aiChatVo.setCreateTime(aiChatHistory.getCreateTime());
		
		return aiChatVo;
	}
}
